package com.ssh.ser.comonstaff;

import com.ssh.dao.StaffDAOI;
import com.ssh.dao.StaffUseCarDAOI;
import com.ssh.entity.Staff;
import com.ssh.entity.StaffUseCar;
import com.ssh.model.pdata.StaffVehicleIOCPData;

public class StaffServiceImpl implements StaffServiceI {
	private StaffDAOI staffDAOI;
	private StaffUseCarDAOI staffUseCarDAOI ;

	/**
	 * @return the staffDAOI
	 */
	public StaffDAOI getStaffDAOI() {
		return staffDAOI;
	}

	@Override
	public Staff login(String staffId, String password) {
		// TODO Auto-generated method stub

		// staffDAO.queryStaffByStaffId(staffId).getStaffId().equals("")

		Staff staff = staffDAOI.queryStaffByStaffId(staffId);;
		return staff;
	}

	/**
	 * @param staffDAOI the staffDAOI to set
	 */
	public void setStaffDAOI(StaffDAOI staffDAOI) {
		this.staffDAOI = staffDAOI;
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.comonstaff.StaffServiceI#leaveByVehhicle(com.ssh.entity.StaffUseCar)
	 */
	@Override
	public StaffUseCar leaveByVehhicle(StaffUseCar staffUseCar) {
		// TODO Auto-generated method stub
		return staffUseCarDAOI.updateBySUC(staffUseCar);
	}

	/**
	 * @return the staffUseCarDAOI
	 */
	public StaffUseCarDAOI getStaffUseCarDAOI() {
		return staffUseCarDAOI;
	}

	/**
	 * @param staffUseCarDAOI the staffUseCarDAOI to set
	 */
	public void setStaffUseCarDAOI(StaffUseCarDAOI staffUseCarDAOI) {
		this.staffUseCarDAOI = staffUseCarDAOI;
	}

	/* (non-Javadoc)
	 * @see com.ssh.ser.comonstaff.StaffServiceI#getSUCById(java.lang.String)
	 */
	@Override
	public StaffUseCar getSUCById(String staffId) {
		// TODO Auto-generated method stub
		return staffUseCarDAOI.queryBySIdState(staffId);
	}

	@Override
	public StaffUseCar backByVehhicle(StaffUseCar staffUseCar) {
		// TODO Auto-generated method stub
		return staffUseCarDAOI.updateBySUC(staffUseCar);
	}

	@Override
	public StaffUseCar verifyByUseCarStaffId(String staffId,String state) {
		// TODO Auto-generated method stub
		return staffUseCarDAOI.queryBySIdState(staffId,state);
	}
	@Override
	public StaffUseCar verifyByUseCarStaffId(String staffId) {
		// TODO Auto-generated method stub
		return staffUseCarDAOI.queryBySIdState(staffId);
	}
	@Override
	public void updateStaffInfo(Staff staff) {
		// TODO Auto-generated method stub
		staffDAOI.updateStaff(staff);
	}

	@Override
	public StaffVehicleIOCPData getAllSUseCarInf(String staffUseCarId, String vehicleId,
			String state) {
		// TODO Auto-generated method stub
		return staffUseCarDAOI.getAllsucInfByscs(staffUseCarId, vehicleId, state);
	}

	@Override
	public StaffVehicleIOCPData getAllSUseCarInf(String staffUseCarId, String state) {
		// TODO Auto-generated method stub
		return staffUseCarDAOI.getAllstaffUseCarInf(staffUseCarId, state);
	}

	@Override
	public StaffVehicleIOCPData getAllSUseCarInf(String staffId,
			String staffUseCarId, String vehicleId, String state) {
		// TODO Auto-generated method stub
		return staffUseCarDAOI.getAllsucInfByscs(staffId, staffUseCarId, vehicleId, state);
	}


}
